In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
In [20]:
fn = 'rpt.00013424.0000000000000000.20141016.182537113.ERCOT_2007_Hourly_Wind_Output.xls'
df = pd.read_excel(fn, 'numbers')
In [4]:
df.head()
Out[4]:
In [21]:
df['Year'] = 2007
In [6]:
df.head()
Out[6]:
In [22]:
df.loc[:,'Day'] = df.loc[:,'Date']
In [23]:
df.loc[:,'time-date'] = pd.to_datetime(df[['Year', 'Month', 'Day', 'Hour']],format='%Y%m%d%h')
In [17]:
df.head()
Out[17]:
In [24]:
cols = df.columns.tolist()
cols = cols[-1:] + cols[:-3]
df = df[cols]
In [25]:
df.head()
Out[25]:
In [27]:
writer = pd.ExcelWriter(fn)
df.to_excel(writer,'numbers')
writer.save()
In [ ]: